package com.witframework.dynoengine.model;

import org.apache.commons.lang.StringUtils;


/**
 * WitMetaColumn entity
 * 关键类
 */

public class WitMetaColumn extends com.witframework.core.BaseEntity implements
		java.io.Serializable {
	
	private static final long serialVersionUID = 1L;
	// Columns
	//基本属性
	private String id;
	private String tableName;//表名称
	private String columnName;//列名称
	private String columnTitle;//列标题
	private String columnDesc;//列说明
	private Integer columnType;//列类型
	private String columnTypeName;//列类型名称
	private Integer columnSize;//列的大小
	private Integer columnPrecision;//列精度,小数部分的位数
	private String columnDefaultValue;// 该列的默认值，当值在单引号内时应被解释为一个字符串（可为 null）
	private String isUnique;//是否唯一
	private String isPkey;//是否主键
	private String isPviewColumn;//是否主显示列,可以作为被导入表时可以用来代替主键显示的列
	private String fkey;//外键 如果是外键，则值为:被导入的主键表名称.被导入的主键列名称 
	private String fkeyViewColumn;//外键主显示列 如果是外键，则值为:被导入表时中用来代替主键显示的列
	
	private String isAutoIncrement;//是否自增列
	private String isNullable;//是否可空	
	private String isEditable;//是否可修改
	//显示属性
	
	private String isQueryable;//是否可查询
	private String isListable;//是否列表
	private String isResultable;//是否包含在查询结果中,优先级为isResultable>isDisplayable
	private String isSortable;//是否排序字段
	private String isDisplayable;//是否显示，如果不显示则为隐藏字段	
	private Integer displaySort;//排序值,值小的显示在前面
	private Integer displaySize;//显示宽度
	private String cellStyle;//单元格样式，值设置格式为style字符串或class=styleClassName
	private String formatClass;//格式化类，如果未指定则使用默认格式化类
	private String groupName;//分组名称,如果设置了该值，将在form页面将表单按照fieldset显示为向导模式
	
	//选择器属性
	private String selectClass;//数据选择器
	private String selectType;//数据选择器类型，select;tree;checkbox;list或mselect;mtree;mcheckbox;mlist(m代表可以多选)
	/**
	 * 数据选择器参数，
	 * 对于select和checkbox类型可以是：vp(值对)=value|text;value|text;...('vp='可以省略);或sql(sql语句)=select table.value value,table.text text from table;
	 * 对于tree和list类型可以是sql(sql语句)=select table.value,table.text from table;
	 */
	private String selectParam;
	//表单域属性
	
	//验证属性
	private String tipText;//字段提示信息
	private String validation;//验证表达式
	private String validateClass;//验证器	

	// Constructors

	/** default constructor */
	public WitMetaColumn() {
	}

	/** minimal constructor */
	public WitMetaColumn(String columnName) {
		this.columnName = columnName;
	}

	
	// Property accessors

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	
	public String getColumnName() {
		return this.columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public String getColumnDesc() {
		return this.columnDesc;
	}

	public void setColumnDesc(String columnDesc) {
		this.columnDesc = columnDesc;
	}

	

	public String getColumnTypeName() {
		return columnTypeName;
	}

	public void setColumnTypeName(String columnTypeName) {
		this.columnTypeName = columnTypeName;
	}

	public Integer getColumnSize() {
		return this.columnSize;
	}

	public void setColumnSize(Integer columnSize) {
		this.columnSize = columnSize;
	}

	public Integer getColumnPrecision() {
		return this.columnPrecision;
	}

	public void setColumnPrecision(Integer columnPrecision) {
		this.columnPrecision = columnPrecision;
	}

	

	public String getIsUnique() {
		return isUnique;
	}

	public void setIsUnique(String isUnique) {
		this.isUnique = isUnique;
	}

	public String getIsPkey() {
		return this.isPkey;
	}

	public void setIsPkey(String isPkey) {
		this.isPkey = isPkey;
	}

	
	public String getFkey() {
		return fkey;
	}

	public void setFkey(String fkey) {
		this.fkey = fkey;
	}

	public String getFkeyViewColumn() {
		return fkeyViewColumn;
	}

	public void setFkeyViewColumn(String fkeyViewColumn) {
		this.fkeyViewColumn = fkeyViewColumn;
	}

	

	public String getIsNullable() {
		return this.isNullable;
	}

	public void setIsNullable(String isNullable) {
		this.isNullable = isNullable;
	}

	public String getIsQueryable() {
		return this.isQueryable;
	}

	public void setIsQueryable(String isQueryable) {
		this.isQueryable = isQueryable;
	}

	
	public String getIsSortable() {
		return this.isSortable;
	}

	public void setIsSortable(String isSortable) {
		this.isSortable = isSortable;
	}

	public Integer getDisplaySort() {
		return this.displaySort;
	}

	public void setDisplaySort(Integer displaySort) {
		this.displaySort = displaySort;
	}

	public Integer getDisplaySize() {
		return this.displaySize;
	}

	public void setDisplaySize(Integer displaySize) {
		this.displaySize = displaySize;
	}

	public String getSelectClass() {
		return this.selectClass;
	}

	public void setSelectClass(String selectClass) {
		this.selectClass = selectClass;
	}

	public String getFormatClass() {
		return this.formatClass;
	}

	public void setFormatClass(String formatClass) {
		this.formatClass = formatClass;
	}



	public String getTipText() {
		return tipText;
	}

	public void setTipText(String tipText) {
		this.tipText = tipText;
	}

	public String getValidation() {
		return validation;
	}

	public void setValidation(String validation) {
		this.validation = validation;
	}

	public String getValidateClass() {
		return validateClass;
	}

	public void setValidateClass(String validateClass) {
		this.validateClass = validateClass;
	}
	
	public Integer getColumnType() {
		return columnType;
	}

	public void setColumnType(Integer columnType) {
		this.columnType = columnType;
	}

	public String getColumnTitle() {
		return StringUtils.isEmpty(columnTitle)?columnName:columnTitle;
	}

	public void setColumnTitle(String columnTitle) {
		this.columnTitle = columnTitle;
	}

	public String getIsListable() {
		return isListable;
	}

	public void setIsListable(String isListable) {
		this.isListable = isListable;
	}

	public String getIsResultable() {
		return isResultable;
	}

	public void setIsResultable(String isResultable) {
		this.isResultable = isResultable;
	}

	public String getIsDisplayable() {
		return isDisplayable;
	}

	public void setIsDisplayable(String isDisplayable) {
		this.isDisplayable = isDisplayable;
	}

	public String getSelectType() {
		return selectType;
	}

	public void setSelectType(String selectType) {
		this.selectType = selectType;
	}

	public String getSelectParam() {
		return selectParam;
	}

	public void setSelectParam(String selectParam) {
		this.selectParam = selectParam;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String getIsEditable() {
		return isEditable;
	}

	public void setIsEditable(String isEditable) {
		this.isEditable = isEditable;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public String getCellStyle() {
		return cellStyle;
	}

	public void setCellStyle(String cellStyle) {
		this.cellStyle = cellStyle;
	}

	
	public String getColumnDefaultValue() {
		return columnDefaultValue;
	}

	public void setColumnDefaultValue(String columnDefaultValue) {
		this.columnDefaultValue = columnDefaultValue;
	}

	public String getIsPviewColumn() {
		return isPviewColumn;
	}

	public void setIsPviewColumn(String isPviewColumn) {
		this.isPviewColumn = isPviewColumn;
	}

	public String getIsAutoIncrement() {
		return isAutoIncrement;
	}

	public void setIsAutoIncrement(String isAutoIncrement) {
		this.isAutoIncrement = isAutoIncrement;
	}

	
}